<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>上传 Excel 文件</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>

    </style>
</head>
<body>
<div id="result"></div>
<script>
    //设置一个标识变量
    let isSending=false;
    let xhr=null;
    window.onkeydown=function () {
        if (isSending) xhr.abort();
        //发送请求
        xhr=new XMLHttpRequest();
        isSending=true;
        //初始化
        xhr.open('GET',"http://localhost:8080/")
        //发送
        xhr.send();
        //事件绑定
        xhr.onreadystatechange=function () {
            if (xhr.status===4){
                isSending=false;
            }
        }
    }

</script>

</body>
</html>